using System.Collections.Generic;
using UnityEngine;

public class UI_QuestTip : MonoBehaviour
{
    private UI_QuestTipSlot[] questTipSlots;
    private PlayerQuestManager questManager;
    private void Awake()
    {
        questTipSlots = GetComponentsInChildren<UI_QuestTipSlot>(true);
    }

    public void SetupQuestTip(List<QuestData> questDatas)
    {
        if (Player.Instance != null)
            questManager = Player.Instance.questManager;

        foreach (var slot in questTipSlots)
            slot.gameObject.SetActive(false);

        for (int i = 0; i < questDatas.Count; i++)
        {
            questTipSlots[i].gameObject.SetActive(true);
            questTipSlots[i].SetupQuestTipSlot(questDatas[i], questManager);
        }
    }
}
